import Vue from 'vue'
const component1 = {
    props: {
        props1: String,
    },
    methods: {

        test01() {
            this.$emit('changeO')
        }
    },
    template: `<div>
   <div>123-{{props1}}</div>
   <button @click='test01'>123</button>
    <slot></slot>
    </div>`
}
new Vue({
    components: {
        component1
    },
    data() {
        return {
            value: 'abc'
        }
    },
    methods: {
        handleClik() {
            console.log('111111111')
        }
    },
    el: '#app',
    render(createElement) { //createElement(标签，属性，元素)
        return createElement(component1, {
            ref: 'comp',
            props: {
                props1: 'props1_1'
            },
            on: {
                changeO: this.handleClik
            },
            nativeOn: {//natvieOn 绑定到主键的根节点，不需要emit出发
                click: this.handleClik
            },
            // domProps: { 使用原生的html操作
            //     innerHTML: '<span>123</span>'
            // },
            attrs: {
                id: 'abc'
            }
        }, [
            createElement('span', {ref: 'span'}, this.value)])
    }
})
